    // 将函数设为对象的属性
    // 执行该函数
    // 删除该函数

    Function.prototype.newCall = function(context) {
      let obj = new Object(context) || window; 
      obj.fn = this // 设置
      let args = [...arguments].slice(1);
      let result = obj.fn(...args);
      delete obj.fn
      return result;
    }



    Function.prototype.newApply = function(context, arr) {
      var context = Object(context) || window;
      context.fn = this;

      let result
      if ( !arr ){
          result = context.fn()
      }else {
          result = context.fn(...arr)
      }
      delete context.fn
      return result;
    }   


    var value = 2;

    var obj = {
      value: 1
    }

    function bar(name, age) {
      // console.log(this.value);
      return {
        value: this.value,
        name: name,
        age: age
      }
    }


    console.log(bar.newCall(obj, 'kevin', 18));